package com.wty.schedule.springSchedule;


import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class Demo {

//
//    @Scheduled(cron = "* * * * * *")
//    public void run(){
//        System.out.println("zzz");
//    }


    @Scheduled(fixedRate = 5000)
    public void run2(){
        System.out.println("每隔五秒执行一次");
    }

    @Scheduled(fixedDelay = 10000)
    public void run3(){
        System.out.println("延迟十秒后执行");
    }




}
